﻿using Himp.Erp;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.DependencyInjection;

namespace Himp.Platform
{
    public class ErpBasicsQuery : ISingletonDependency
    {
        private readonly IServiceProvider _serviceProvider;

        public ErpBasicsQuery(IServiceProvider serviceProvider)
        {
            _serviceProvider = serviceProvider;
        }

        public async Task<PagedResultDto<MatlInfoDto>> GetMaterialInfoListAsync(MatlInfoInput input)
        {
            var materialInfoService = _serviceProvider.GetService<IMatlInfoService>();

            return await materialInfoService.GetListAsync(input);
        }

        /// <summary>
        /// 物料供应商列表
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultDto<MatlSplerDto>> GetMaterialSupplierListAsync(MatlSupplierInput input)
        {
            var materialSupplierService = _serviceProvider.GetService<IMatlSupplierService>();

            return await materialSupplierService.GetListAsync(input);
        }

        /// <summary>
        /// 物料仓库
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultDto<MatlWhseDto>> GetMatlWhseListAsync(MatlWhseInput input)
        {
            var matlWhseService = _serviceProvider.GetService<IMatlWhseService>();

            return await matlWhseService.GetListAsync(input);
        }
    }
}
